﻿USE MusicAcademy
GO

USE [MusicAcademy]
GO

/****** Object:  Table [dbo].[FreeTime]    Script Date: 12/14/2012 00:29:28 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[FreeTime](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[teacherID] [bigint] NOT NULL,
	[date] [varchar](10) NOT NULL,
	[DOW] [tinyint] NOT NULL,
	[fromTime] [varchar](5) NOT NULL,
	[toTime] [varchar](5) NOT NULL,
	[academyID] [int] NOT NULL,
 CONSTRAINT [PK_FreeTime] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[FreeTime]  WITH CHECK ADD  CONSTRAINT [FK_FreeTime_Academy] FOREIGN KEY([academyID])
REFERENCES [dbo].[Academy] ([ID])
GO

ALTER TABLE [dbo].[FreeTime] CHECK CONSTRAINT [FK_FreeTime_Academy]
GO

ALTER TABLE [dbo].[FreeTime]  WITH CHECK ADD  CONSTRAINT [FK_FreeTime_Person] FOREIGN KEY([teacherID])
REFERENCES [dbo].[Person] ([ID])
GO

ALTER TABLE [dbo].[FreeTime] CHECK CONSTRAINT [FK_FreeTime_Person]
GO

